home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 3.2 / Ham Radio Version 3.2 (Chestnut CD-ROMs)(1993).ISO / mods / pk232src / tnc1w.pas < prev    next >
Pascal/Delphi Source File  |  1986-09-10  |  8KB  |  185 lines

  1.   {.PL66}
  2.   {.IN+}
  3.   {.PO5}
  4.   {.CC#15}
  5.   {.PW132}
  6.   {.HE Split/Screen Terminalprogram for the TNC-1/WA8DED}
  7.   {.FO Page #}
  8.   {//////////////////////////////////////////////////////////////////////////}
  9.   {/////         Split/Screen Terminalprogram for the TNC-1/WA8DED    ///////}
  10.   {//////////////////////////////////////////////////////////////////////////}
  11.   { This program was written by HB9CVV, most of the code (windowing, and     }
  12.   { the asynchronous Com-port server) has been adopted from existing sources }
  13.   {                                                                          }
  14.   { This module contains the TNC device-specific part                        }
  15.   {--------------------------------------------------------------------------}
  16.  
  17. PROGRAM TNC_TAPR;
  18.  
  19.     {$C-}
  20.     {$U-}
  21.  
  22.   CONST logo = '<<<<<<<<<< TNC-1/WA8DED - Terminal Server *** Sep/86 HB9CVV >>>>>>>>>>';
  23.  
  24.   CONST parfilnam = 'TNC1WRIG.PAR';     { filename of rig-parameter file }
  25.   CONST cmdchr = ^[;                    { get command-mode char is escape}
  26.   CONST Tnc_echo_on = True;             { echoing on }
  27.   CONST Send_ok = False;                { Send file feature disabled - NO HW-handshake availabe ! }
  28.  
  29.   CONST DefPort = 2;                    { Default Com Port}
  30.   CONST DefBaud = 4800;                 { Default Baudrate}
  31.  
  32.   CONST PTOOLWIN_Number_of_Windows = 4; { Number of pop-up windows }
  33.  
  34.     {$I SSS_DECL.PAS }
  35.     {$I SSS_ASYN.PAS }                  {I/O Routines for Comm-port}
  36.     {$I SSS_PWIN.PAS }                  {PTOOLWIN functions and parameters }
  37.     {$I SSS_SUBR.PAS }                  {Common subroutines}
  38.  
  39.     {=============================================================================+
  40.     |                                                                             |
  41.     |  This Module contains device dependant routines                             |
  42.     |                                                                             |
  43.     |-----------------------------------------------------------------------------|
  44.     |                                                                             |
  45.     |  InitHelpwindows     -- define size of the three helpwindows                |
  46.     |  HelpWindow1         -- write the first helpwindow                          |
  47.     |  HelpWindow2         -- write the second helpwindow                         |
  48.     |  HelpWindow3         -- write the third helpwindow                          |
  49.     |  ResetParam          -- send commands to reset the params of the device     |
  50.     |  InitDevice          -- Initialize the device                               |
  51.     |  ShutdownDevice      -- Shut down the device                                |
  52.     |                                                                             |
  53.     +-----------------------------------------------------------------------------}
  54.  
  55.     {-----------------------------------------------------------------------------+
  56.     | Define three pop-up help windows                                            |
  57.     +-----------------------------------------------------------------------------}
  58.  
  59.   PROCEDURE InitHelpWindows;
  60.  
  61.     BEGIN
  62.       PTOOLWIN_Screen_Type := 'X';
  63.       PTWSet(1, 12, 2, 64, 24, 1, 0, 12);
  64.       PTWSet(2, 35, 1, 75, 23, 2, 0, 14);
  65.       PTWSet(3, 25, 1, 60, 20, 2, 0, 10);
  66.     END;
  67.  
  68.     {-----------------------------------------------------------------------------+
  69.     | Define Help window number ONE                                               |
  70.     +-----------------------------------------------------------------------------}
  71.  
  72.   PROCEDURE HelpWindow1;
  73.  
  74.     BEGIN
  75.       PTWOpen(1);
  76.       ClrScr;
  77.       GoToXY(2, 1); Write('C call1 [call2 ... call9] Connect');
  78.       GoToXY(2, 2); Write('D         Disconnect');
  79.       GoToXY(2, 3); Write('L [0..4]  Display status');
  80.       GoToXY(2, 4); Write('F 1..15   Frame Ack time (s)');
  81.       GoToXY(2, 5); Write('N 0..255  Retry Count');
  82.       GoToXY(2, 6); Write('O 1..7    Maxframes');
  83.       GoToXY(2, 7); Write('R 0/1     Digipeater on/off');
  84.       GoToXY(2, 8); Write('S 0..4    Select Channel');
  85.       GoToXY(2, 9); Write('V 1/2     Protocoll version 1/2');
  86.       GoToXY(2, 10); Write('Y 0..4    Enable channels');
  87.       GoToXY(2, 12); Write('U 0 text     No untattended mode');
  88.       GoToXY(2, 13); Write('U 1 ctext    Unattended mode');
  89.       GoToXY(2, 14); Write('U 2 int text Beacon mode');
  90.       GoToXY(2, 16); Write('M NIUSCRT    Monitor mode');
  91.       GoToXY(2, 17); Write('          N: No packets      I: Info packets');
  92.       GoToXY(2, 18); Write('          U: Unproto packets S: Control packets');
  93.       GoToXY(2, 19); Write('          R: Packets for us  T: Packets from us');
  94.       GoToXY(2, 20); Write('          C: When connected');
  95.  
  96.       GoToXY(2, 21); Waitreturn(20000.0);
  97.       PTWClose;
  98.       TextColor(15);
  99.       TextBackground(0);
  100.     END;
  101.  
  102.     {-----------------------------------------------------------------------------+
  103.     | Define Help window number TWO                                               |
  104.     +-----------------------------------------------------------------------------}
  105.  
  106.   PROCEDURE HelpWindow2;
  107.  
  108.     BEGIN
  109.       PTWOpen(2);
  110.       ClrScr;
  111.       GoToXY(2, 1); Write('A 0/1      AutoLF on/off');
  112.       GoToXY(2, 2); Write('B 1..15    Terminal Baudrate');
  113.       GoToXY(2, 3); Write('E 0/1      Echo on/off');
  114.       GoToXY(2, 4); Write('H 50..9600 HDLC Baudrate');
  115.       GoToXY(2, 5); Write('I call     Station call');
  116.       GoToXY(2, 6); Write('K 1..2     Calibration');
  117.       GoToXY(2, 7); Write('PERM       Store permanent');
  118.       GoToXY(2, 8); Write('QRES       Reset');
  119.       GoToXY(2, 9); Write('T 0..127   Transmit Delay (10mS)');
  120.       GoToXY(2, 10); Write('W 0..127   Digipeater Delay (10mS)');
  121.       GoToXY(2, 11); Write('X 0/1      TX disable/enable');
  122.       GoToXY(2, 12); Write('Z 0        Flow off, Xon/Xoff off');
  123.       GoToXY(2, 13); Write('Z 1        Flow on,  Xon/Xoff off');
  124.       GoToXY(2, 14); Write('Z 2        Flow off, Xon/Xoff on');
  125.       GoToXY(2, 15); Write('Z 3        Flow on,  Xon/Xoff on');
  126.       GoToXY(2, 16); Write('@B         Display number of buffers');
  127.       GoToXY(2, 17); Write('@S         Display link status');
  128.       GoToXY(2, 18); Write('@T2        Ack timer (10mS)');
  129.       GoToXY(2, 19); Write('@T3        Timeout timer (10mS)');
  130.       GoToXY(2, 21); Waitreturn(20000.0);
  131.       PTWClose;
  132.       TextColor(15);
  133.       TextBackground(0);
  134.     END;
  135.  
  136.  
  137.     {-----------------------------------------------------------------------------+
  138.     | Reset the parameters of the TNC-1. When we do this, we at least assume      |
  139.     | that the communication to the TNC-1 is working.                             |
  140.     +-----------------------------------------------------------------------------}
  141.  
  142.   PROCEDURE RESETPARAM;
  143.     BEGIN
  144.     END;
  145.  
  146.     {-----------------------------------------------------------------------------+
  147.     | Init the TNC-1/WA8.                                                         |
  148.     +-----------------------------------------------------------------------------}
  149.  
  150.   PROCEDURE Initdevice;
  151.     VAR daycmdstr : STRING[40]; cha : Char;
  152.     BEGIN
  153.       Async_Send_String(^Q);            {unlock it from possible locks}
  154.       Delay(1000);                      {Wait for return strings}
  155.       Async_Purge_Buffer;               {flush}
  156.       Async_Send_String(^['QRES'^M);
  157.       Delay(1000);
  158.       Async_Send_String(^['L'^M);       {get status of TNC}
  159.     END;
  160.  
  161.     {-----------------------------------------------------------------------------+
  162.     | Shutdown the TNC-1.                                                         |
  163.     +-----------------------------------------------------------------------------}
  164.  
  165.   PROCEDURE Shutdowndevice;
  166.  
  167.     BEGIN
  168.       Async_Send_String(^S);
  169.       Delay(200);
  170.     END;
  171.  
  172.     {------------------------------------------------------------------------+
  173.     | DEVICE SPECIAL FUNCTIONS                                               |
  174.     +------------------------------------------------------------------------}
  175.  
  176.   PROCEDURE DEV_SPC_FUN(fn : Integer);
  177.     BEGIN
  178.     END;
  179.  
  180.   PROCEDURE SWITCH_DEV_MODE;            {ALT/F1...ALT/F10}
  181.     BEGIN                               {dummy, nothing to switch}
  182.     END;
  183.  
  184.     {$I SSS_MAIN.PAS }
  185.